<template>
    <div class="item" @click="toStore">
        <img :src="itemContent.pic" />
        <div class="itme-right">
            <span class="title">{{itemContent.title}}</span>
            <span class="sales">{{itemContent.sales}}</span>
            <span class="price">{{itemContent.price}}</span>
            <div class="label">
                <span v-for="(item,index) in itemContent.label" :key="index">{{item}}</span>
            </div>
        </div>
    </div>
</template>

<script>
import {useRouter} from 'vue-router'
export default {
    props:['itemContent'],
    setup(){
        const router = useRouter();
        const toStore = ()=>{
            router.push('/stores')
        }
        return {
            toStore
        }
    }
};
</script>

<style lang="less" scoped>
.item{
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    img{
        height: 120px;
        width: 120px;
        border-radius: 10px;
    }
    .itme-right{
        height: 120px;
        width: 180px;
        font-size: 14px;
        display: flex;
        flex-flow: column;
        justify-content: space-around;
        .title{
            font-size: 16px;
            font-weight: 600;
        }
        .label{
            span{
                background-color: orange;
                padding: 5px;
                border-radius: 5px;
            }
            span:not(:first-child){
                margin-left: 10px;
            }
        }
       
    }
}
</style>